'use strict'
let list=[
    {
        id:1,
        name:'哈哈'
    },
    {
        id:2,
        name:'哈哈2'
    },
    {
        id:3,
        name:'哈哈3'
    }
]
function fu_rou(ctx,next){
    ctx.body=request.params.id || 0;
    console.log(ctx.body);
    let items = list.filter(item=>{
        console.log(item.id);
        return item.id == id
    })
    return items.length >0 ?items[0] : {}
}
function fu_rougetById(ctx,next){
    let id = ctx.request
}
function fu_post(ctx,next){
    
}
function fu_put(ctx,next){
    
}
function fu_delect(ctx,next){
    
}


module.exports = {
    'get/rou':fu_rou,
    'get/rou/id':fu_rougetById,
    'post/rou':fu_post,
    'put/rou/id': fu_put,
    'delect/rou/id':fu_delect
}